function getInterviewAll() {
    $.ajax({
        type: 'get',
        url: 'http://39.106.207.209:8100/interview/getInterviewAll',
        success(res) {
            let userinfo = res.data;
            // console.log(userinfo);
            let str = '';
            for (let i = 0; i < userinfo.length; i++) {
                let v = userinfo[i].timeview //把返回的时间用一个变量装

                // 替换字符串中指定位置的字符 （把返回时间中的 T 截取换成 空字符）
                function replacepos(text, stop, replacetext) {
                    mystr = text.substring(0, stop - 1) + replacetext + text.substring(stop + 1);
                    return mystr;
                }
                endstr = replacepos(v, 10, ' ')
                    // console.log(endstr);
                str += `
                <ul id="h_item">
                    <li>
                        <span class="kind">公司：</span>
                        <span>${userinfo[i].companyname}</span>
                    </li>
                    <li>
                        <span class="kind">时间：</span>
                        <span>${endstr}</span>
                    </li>
                    <li>
                        <span class="kind">岗位：</span>
                        <span>${userinfo[i].job}</span>
                    </li>
                    <li>
                        <span class="kind">hr电话：</span>
                        <span>${userinfo[i].phone}</span>
                    </li>
                    <li>
                        <span class="kind">状态：</span>
                        <span>已面试</span>
                    </li>
                    <hr>
                    <li class="item_state flex">
                        <button class="item_a">放弃面试</button>
                        <button class="item_b">去做复盘</button>
                        <button class="item_c" onclick='details(${userinfo[i].id})'>查看详情</button>
                        <button class="item_d" onclick='lockMap()'>看地图</button>
                    </li>
                </ul>
                `;
            }
            $('#interViewAll').html(str);
        }
    })
}
getInterviewAll()

// 点击查看详情事件
function details(id) {
    window.location = '../details/details.html?' + id;
}

// 点击查看地图事件
function lockMap() {
    window.location = '../map/initmap.html';
}